#ifndef _CRT_ENDIAN_H
#define _CRT_ENDIAN_H

#include <crt_core.hpp>

#ifdef __cplusplus
extern "C" {
#endif

#define null_endian   0
#define big_endian    1
#define little_endian 2

int is_big_little(void);

uint16_t blushort(uint16_t value);
uint32_t bluint32(uint32_t value);
int uint64touint32(uint64_t u64value, uint32_t* u32value);

uint16_t un_gets(const uint8_t* buf);
void un_puts(uint8_t* buf, uint16_t val);
uint32_t un_getl(const uint8_t* buf);
void un_putl(uint8_t* buf, uint32_t val);
uint64_t un_getll(const uint8_t* buf);
void un_putll(uint8_t* buf, uint64_t val);

#ifdef __cplusplus
}
#endif

#endif
